#ifndef __DOUBLELINKLIST_H_
#define __DOUBLELINKLIST_H_

#define ElementType void *
struct Node
{
    ElementType data;
    struct Node *next;
    struct Node *prev;
};
struct DoubleLinkList
{
    struct Node *head;
    struct Node *tail;
    int len;
};

typedef struct DoubleLinkList DLlist;
int InitDLinkList(DLlist *list);
void InsertTail(DLlist *list,ElementType element);
void Travel(DLlist *list);
void FreeDLinklist(DLlist *list);
void InsertHead(DLlist *list,ElementType element);
void InsertIndex(DLlist *list,ElementType element,int index);
void RemoveByIndex(DLlist *list,int index);
void RemoveByElement(DLlist *list,ElementType element);
int GetListLen(DLlist *list);
int FindFirstByElement(DLlist *list,ElementType element);

#endif